package fristphase.day04;

public class 匿名对象 {
    public static void main(String[] args) {
        School school = new School();
        school.fun(new Student("张三","黑龙江"));
        school.funTest01();
    }
}
class Student{
    String name,address;
    Student(String name,String address){
        this.name = name;
        this.address = address;
    }
    void sayHello(){
        System.out.println("你好");
    }
    void sayIntroduce(){
        System.out.println("我是"+name+"，我来自"+address+"请多多关照");
    }
}
class School{
    void fun(Student a){
        a.sayHello();
        a.sayIntroduce();

    }
    void funTest01(){
        new Student("李四","上海").sayIntroduce();
    }
}

